package engine;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;

import com.tetris.project.Shr_Res;

public class FakeButton {

	private int x, y, h, w;
	Bitmap image;
	
	public FakeButton (int xPosition, int yPosition, int buttonHeight, int buttonWidth){
		x = xPosition;
		y = yPosition;
		h = buttonHeight;
		w = buttonWidth;
	}
	
	public boolean isButtonPressed( float touchXPos, float touchYPos){
		if(touchXPos > x && touchXPos < x+w && touchYPos > y && touchYPos < y+h){
			Log.d(Shr_Res.TAG, "You pressed a fake button");
			return true;
		}
		return false;
	}
	
	public void drawFakeButton(Canvas canvas, Bitmap imageButton, Paint paint){
		canvas.drawBitmap(imageButton, x, y, paint);
	}
	
	public void setPosition(int xPosition, int yPosition){
		x = xPosition;
		y = yPosition;
	}
	
}

/*if(!Shr_Res.ImgButtonPressed){canvas.drawBitmap(nextbgImage, nextbgImageX, nextbgImageY, null);}

if(Shr_Res.touchXPosition > GamePlayView.mWindowWidth/3*2 && Shr_Res.touchXPosition < (GamePlayView.mWindowWidth/3*2+nextbgImageWidth)){
	if(Shr_Res.touchYPosition > GamePlayView.mWindowHeight/5*4 && Shr_Res.touchYPosition < (GamePlayView.mWindowHeight/5*4+nextbgImageHeight)){
		if(!Shr_Res.ImgButtonPressed){
			Log.d(Shr_Res.TAG, "You pressed next image button in portrait");
			//if(Shr_Res.ImgButtonPressed){canvas.drawBitmap(nextbgImagePressed, GamePlayView.mWindowWidth/3*2, GamePlayView.mWindowHeight/5*4, null);}
			Shr_Res.touchXPosition = 0;
			Shr_Res.touchYPosition = 0;
			picture++;
			if(picture > 1){picture=0;}
		}
		else if (Shr_Res.ImgButtonPressed){
			canvas.drawBitmap(nextbgImagePressed, nextbgImageX, nextbgImageY, null);
		}
	}
	else if(Shr_Res.ImgButtonPressed){
		canvas.drawBitmap(nextbgImage, nextbgImageX, nextbgImageY, null);
	}
}
else if (Shr_Res.ImgButtonPressed){
	canvas.drawBitmap(nextbgImage, nextbgImageX, nextbgImageY, null);
}*/